import React, { Component } from 'react'
import { Switch, Route, Redirect, withRouter } from 'react-router-dom'
import Admin from './pages/Admin'
class App extends Component {
  render() {
    // 默认不是通过路由切换过来的组件 无法在props中获取路由参数
    console.log(this.props)
    return (
      <div>
        <Switch>
          <Redirect exact from="/" to="/manager"></Redirect>
          <Route path="/manager" component={Admin}></Route>
        </Switch>
      </div>
    )
  }
}
// 使用withRouter高阶组件  使组件获取到路由相关操作方法和参数信息
export default withRouter(App)
